<include file="Public:header" />
<include file="Public:left" />
<style>
    td{text-align:center;}
</style>
<section>
    <div class="page_title">
        <h2 class="fl">项目列表</h2>
        <form action="" >
            <input type="text" class="page_title_input" name="item_name" placeholder="项目名" value="{$item_name?$item_name:'';}">
            <input type="text" class="page_title_input" name="name" placeholder="企业名" value="{$name?$name:'';}">
            <input type="text" class="page_title_input" name="certificate_no" placeholder="证书编号" value="{$certificate_no?$certificate_no:'';}">
            <input type="text" class="page_title_input" name="time_batch" placeholder="时间批次" value="{$time_batch?$time_batch:'';}">
            <select name="type">
                <option value="0" >请选择项目类别</option>
                <volist name="project_type" id="vo">
                <option value="{$vo.id?$vo.id:'';}" <if condition="$type eq $vo.id">selected='selected'</if>>{$vo.type_name}</option>
                </volist>
            </select>
            <input  class="page_title_submit" type="submit" value="搜索">
        </form>
    </div>
    <table class="table">
        <tr>
            <th>项目名</th>
            <th>时间/批次</th>
            <th>证书编号</th>
            <th>补助金额</th>
            <th>项目类别</th>
            <th>企业名</th>
            <th>备注</th>
            <th style="width:150px;">操作</th>
        </tr>
        <volist name="project_result" id="vo">
           <tr>
                <td>{$vo.item_name}</td>
                <td>{$vo.time_batch}</td>
                <td>{$vo.certificate_no}</td>
                <td>{$vo.subsidy_amount/1000}</td>
                <td>{$vo.type_name}</td>
                <td>{$vo.name}</td>
                <td>{$vo.note}</td>
                <td>
                    <a href="javascript:void(0)" id="{$vo['id']}"  class="inner_btn dynamic_del" >删除</a>
                </td>
           </tr>
       </volist>
    </table>
    {$page}
</section>
<script>
//    删除项目
    $('.dynamic_del').click(function(){
        var id = $(this).attr('id');
        layer.confirm('删除数据无法恢复，并且会影响用户数据，确定删除？', {
            btn: ['确定', '取消']
        }, function() {
            $.post("{:url('Project/delete')}", {id: id}, function (result) {

                if (result.code == '0') {
                    layer.alert(result.msg);
                } else {
                    layer.alert(result.msg, {
                        btn: ['确定']
                    },
                    function (index, item) {
                        //layer.close(index);
                        location.reload();
                    });
                }
            });
        });
    });
</script>
 </div>
</section>
</body>
</html>
